﻿function tijiao() {
    var zongfen = 0;
    var xm = document.getElementById("xm").value;
    for (var q = 1; q < 6; q++) {
        var inp = document.getElementsByName("input_" + q);
        var yan = zongfen;
        for (var i = 0; i < inp.length; i++) {
            if (inp[i].checked == true) {
                zongfen = parseInt(zongfen) + parseInt(inp[i].value);
                break;
            }
        }
        if (yan == zongfen) {
            alert("请全部选中");
            break;
        }
        else {
            //q==题数
            if (q == 5) {
                $.get("性格测试.ashx", { xm: xm, fs: zongfen }, function (date) {
                    if (date == "ture") {
                        alert("成功");
                    }
                    else {
                        alert("请从新录入");
                    }
                });
            }
        }
    }
}